<!DOCTYPE html>
<html lang="zh">
<head>
    <th:block th:include="include :: header('基本表单')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-5">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal" id="login">
                        <h3 class="m-t-none m-b">登陆</h3>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">用户名：</label>

                            <div class="col-sm-8">
                                <input type="text" name="loginName" placeholder="用户名" class="form-control" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">密码：</label>

                            <div class="col-sm-8">
                                <input type="password" name="passowrd" placeholder="密码" class="form-control" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-8">
                                <button class="btn btn-sm btn-white" onclick="login()">登 陆</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "web/WebUser";
    $("#login").validate({
        focusCleanup: true
    });
    function login() {
        if ($.validate.form()) {
            $.operate.post(prefix + "/login", $('#login').serialize(),function (data) {
                if (data){
                   alert("账号密码正确")
                } else {
                    alert("账号密码错误")
                }
            });
        }
    }
</script>
</body>
</html>
